package com.medicine.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.medicine.dao.impl.CkxxDao;
import com.medicine.dao.impl.GysDao;

import pagination.Page;
import po.Ckxx;
import po.Gys;
import po.Rkxx;
import po.Ypxx;
import requestvo.GysReqVo;
import requestvo.SupplierReqVo;
import requestvo.YpkcxxReqVo;

@Service
public class SupplierService extends BaseServiceImpl{
	public Page findsupplierxx(SupplierReqVo supplierReqVo){
		Page<SupplierReqVo> page=new Page<>();
		if (supplierReqVo.getGys_no() != null&&!supplierReqVo.getGys_no().equals("")){
			page.getParams().put("gys_no", supplierReqVo.getGys_no());
		}
		if(supplierReqVo.getGys_name()!=null&&!supplierReqVo.getGys_name().equals("")) {
			page.getParams().put("gys_name", "%"+supplierReqVo.getGys_name()+"%");
		}
		if(supplierReqVo.getGys_people()!=null&&!supplierReqVo.getGys_people().equals("")){
			page.getParams().put("gys_people", "%"+supplierReqVo.getGys_people()+"%");
		}
		if(supplierReqVo.getGys_tel()!=null&&!supplierReqVo.getGys_tel().equals("")){
			page.getParams().put("gys_tel", supplierReqVo.getGys_tel());
		}
		if(supplierReqVo.getGys_mail()!=null&&!supplierReqVo.getGys_mail().equals("")){
			page.getParams().put("gys_mail", supplierReqVo.getGys_mail());
		}
		if(supplierReqVo.getGys_dz()!=null&&!supplierReqVo.getGys_dz().equals("")){
			page.getParams().put("gys_dz",supplierReqVo.getGys_dz());
		}
		if(supplierReqVo.getDes()!=null&&!supplierReqVo.getDes().equals("")){
			page.getParams().put("des",supplierReqVo.getDes());
		}
		page.setPageNo(supplierReqVo.getPage());
		page.setPageSize(supplierReqVo.getRows());
		page.setResults(supplierDao.findPage(page));
		return page;
	}
	
	
	
	public void updategysxx(SupplierReqVo supplierReqVo)  {
		// TODO Auto-generated method stub
		supplierDao.update(supplierReqVo);
		
	}
	public void addgysxx(SupplierReqVo supplierReqVo) {
		// TODO Auto-generated method stub
		supplierDao.insert(supplierReqVo);
	}
	public void delgysxx(String[] integers) {
		// TODO Auto-generated method stub
		supplierDao.delete(integers);
	}

}
